VA Report Example: Use a pop-up page to link to additional detail
Recent Library Articles
Recently in the SAS Community Library: SAS' @TeriPatsilaras shows you how to design a pop-up page in SAS Visual Analytics to show more detail, such as category and measure data items.
Below are the code to create a regular forest plot that I found online:
proc sgplot data=forest_subgroup_2 nowall noborder nocycleattrs dattrmap=attrmap noautolegend;
format text $txt.;
styleattrs axisextent=data;
refline ref / lineattrs=(thickness=13 color=cxf0f0f7);
highlow y=obsid low=low high=high;
scatter y=obsid x=mean / markerattrs=(symbol=squarefilled);
scatter y=obsid x=mean / markerattrs=(size=0) x2axis;
refline 1 / axis=x;
text x=xl y=obsid text=text / position=bottom contributeoffsets=none strip;
yaxistable subgroup / location=inside position=left textgroup=id labelattrs=(size=7)
textgroupid=text indentweight=indentWt;
yaxistable countpct / location=inside position=left labelattrs=(size=7) valueattrs=(size=7);
yaxistable PCIGroup group pvalue / location=inside position=right pad=(right=15px)
labelattrs=(size=7) valueattrs=(size=7);
yaxis reverse display=none colorbands=odd colorbandsattrs=(transparency=1) offsetmin=0.0;
xaxis display=(nolabel) values=(0.0 0.5 1.0 1.5 2.0 2.5);
x2axis label='Hazard Ratio' display=(noline noticks novalues) labelattrs=(size=8);
run;
This code put countpct on the left right after subgroup, then followed by the scatter plots. The PCIgroup, group, and pvalue are on the right side of the graph after the scatter plots.
Based on this code, I want to create an new forest plot with two scatter plots on both left and right side, and subgroup in the middle. In case way I can show two different outcomes on one graph. Can anyone help me? Thank you!
... View more
Hi .
What is the correct code using Proc GLM to test a 2-groups one-sided hypothesis where the hypothesis is H0: Difference between groups <= 4, H1: Difference between groups > 4? The model will include baseline and site as covariates.
Thanks.
... View more
I have two data sets (set1 set2) with a common id.
data set1;
input id $ d_start :date9. d_end :date9.
physcat $ a b c d e;
format d_start d_end date9.;
datalines;
s001 01JAN2020 31DEC2020 A 1 2 3 1 0
s001 01JAN2020 31DEC2020 A 1 3 3 1 0
s001 01JAN2021 31DEC2021 B 1 3 3 2 1
s002 01JUN2019 31MAY2020 A 2 1 2 1 1
s002 01JUN2020 31MAY2021 C 2 2 2 2 0
s003 01JAN2020 31DEC2022 B 1 3 4 1 0
;
run;
data set2;
input id $ eventstart :date9.;
format eventstart date9.;
datalines;
s001 15JUN2020
s001 20JUL2021
s002 15AUG2019
s002 01JUL2020
s003 01JAN2021
s003 01JAN2023
;
run;
I am trying to join specific variables from set1 to set2 (physcat, a, b, c, d, e) by id where eventstart falls within a d_start and d_end date range in set1.
*In the case more than 1 observation from set1 had date ranges that include eventstart, I would want to take the variable values from the observation with the lowest b, c and d. These are temporal categorical variables where lower values would indicate earlier time (i.e. before a birthday or promotion), and they should increase uniformly together or singularly, but not reverse order. In the example above for s001, the first observation has lower values (2 3 1) than the second observation (3 3 1) so I would want the former if eventstart fell in that range. * The desired dataset would look like this:
data merged;
input id $ eventstart :date9.
physcat $ a b c d e;
format eventstart date9.;
datalines;
s001 15JUN2020 A 1 2 3 1 0
s001 20JUL2021 B 1 3 3 2 1
s002 15AUG2019 A 2 1 2 1 1
s002 01JUL2020 C 2 2 2 2 0
s003 01JAN2021 B 1 3 4 1 0
s003 01JAN2023 . . . . . . /* I do not think there should be any cases without matches, but if there were I would want to retain with missing values */
;
run;
What is the simplest way to do this? I have tried a few different joins with proc sql but am obviously making mistakes, as they end up producing more observations for an id than exist in set2. Set2 should maintain the same number of observations prior to merge/join.
... View more
Hi everyone,
I'm currently facing a challenge when trying to export and version SAS Job files to GitHub.
I'm working in a SAS Viya 3.5 environment, using SAS Studio Code, and I noticed there’s no direct option to download the complete SAS Job file (including its definition, HTML interface, and parameters). Because of that, I’m manually versioning the files like this:
job_name.sas → containing the main code
job_name.html → containing the job’s HTML interface
job_name.txt → containing the parameters used
So I’d like to ask:
Is there any official or more practical way to export SAS Job files to GitHub?
Or any strategy to make this versioning process more organized and efficient?
I’d really appreciate any tips or experiences you can share.
Thanks in advance!
... View more
Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.